package per.hx.bs.web.yw.service;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.context.annotation.Primary;
import org.springframework.web.bind.annotation.*;
import per.hx.bs.base.domain.ReturnDTO;
import per.hx.bs.entity.yw.YwAppraisalApplyDO;
import per.hx.bs.entity.yw.YwAppraisalDataDO;

import java.util.List;
import java.util.Map;

/**
 * @author HuXing
 * @date 2018/4/19  15:43
 */
@Primary
@FeignClient(value = "Huxingbs-Sys-Service")
public interface YwAppraisalApplyService {
    /**
     * 获取需要审核的考核信息
     *
     * @param params 条件
     * @return 审核信息
     */
    @PostMapping(value = "yw-service/appraisalApply/list")
    List<YwAppraisalApplyDO> list(@RequestBody Map<String, Object> params);

    /**
     * 获取需要审核的种条数
     *
     * @param params 条件
     * @return 数量
     */
    @PostMapping(value = "yw-service/appraisalApply/count")
    int count(@RequestBody Map<String, Object> params);

    /**
     * 通过id获取数据
     *
     * @param id id
     * @return 申请信息
     */
    @GetMapping(value = "yw-service/appraisalApply/{id}")
    YwAppraisalApplyDO selectOne(@PathVariable("id") Long id);

    /**
     * 插入申请
     *
     * @param applyDO 申请信息
     * @return 影响行数
     */
    @PostMapping(value = "yw-service/appraisalApply/insert")
    int insert(@RequestBody YwAppraisalApplyDO applyDO);

    /**
     * 更新申请
     *
     * @param applyDO 申请信息
     * @return 影响行数
     */
    @PutMapping(value = "yw-service/appraisalApply/update")
    int update(@RequestBody YwAppraisalApplyDO applyDO);


    /**
     * 通过id获取数据
     *
     * @param id id
     * @return 申请信息
     */
    @GetMapping(value = "yw-service/appraisalApply/data")
    YwAppraisalDataDO selectOneData(@RequestParam("id") Long id);

    /**
     * 插入申请数据
     *
     * @param dataDO 申请信息
     * @return 回调结果
     */
    @PostMapping(value = "yw-service/appraisalApply/insertData")
    Long insertData(@RequestBody YwAppraisalDataDO dataDO);

    /**
     * 更新申请数据
     *
     * @param dataDO 申请信息数据
     * @return 或吊结果
     */
    @PutMapping(value = "yw-service/appraisalApply/updateData")
    int updateData(@RequestBody YwAppraisalDataDO dataDO);
}
